<% title _('Realms') %>
<% title_actions(new_link(_("Create Realm")),
                 documentation_button('4.3.8Realm')) %>

<table class="<%= table_css_classes 'table-fixed' %>">
  <thead>
    <tr>
      <th class="col-md-8"><%= sort :name, :as => s_("Realm|Name") %></th>
      <th><%= _("Hosts") %></th>
      <th><%= _('Actions') %></th>
    </tr>
  </thead>
  <tbody>
    <% @realms.each do |realm| %>
    <tr>
      <td class="ellipsis"><%= link_to_if_authorized realm.name, hash_for_edit_realm_path(:id => realm)%></td>
      <td><%= link_to hosts_count[realm], current_hosts_path(:search => "realm = #{realm}") %>
      <td class="col-md-1"><%= action_buttons display_delete_if_authorized hash_for_realm_path(:id => realm), :data => { :confirm => _("Delete %s?") % realm.name } %></td>
    </tr>
    <% end %>
  </tbody>
</table>
<%= will_paginate_with_info @realms %>
